<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>练习函数</title>
    <script>
        function sum(a,b) {
            // var he = a + b;
            return  a+b;
        }
        var a = sum(1,29);
        // console.log(a);
        arr = [2,2,2];
        var bbb =arr.reduce((a,b) => a + b,0);
        console.log(bbb)
        console.log((arr.reduce((a,b) => a+b),0));
        console.log(arr.length * arr[0]);
        console.log( ((arr.reduce((a,b) => a+b),0) == arr.length*arr[0]))
            [0, 1, 2, 3, 4].reduce((accumulator, currentValue, currentIndex, array) => { return accumulator + currentValue; }, 10 );
    </script>
</head>
<body>

</body>
</html>